package com.tbh.annotation.event;

import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class EventMain {
    public static void main(String[] args) {
        ConfigurableApplicationContext configurableApplicationContext
                = new ClassPathXmlApplicationContext("Beans.xml");
        configurableApplicationContext.start();
        HelloWorld obj = (HelloWorld) configurableApplicationContext.getBean("helloWorld1");

        obj.getMessage();
        // 重新加载bean
        configurableApplicationContext.refresh();
        configurableApplicationContext.stop();
        configurableApplicationContext.close();

    }
}
